package com.agriculture.monitor.util;


import com.agriculture.monitor.constant.Constant;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

public class JwtUtils {
    public static void main(String[] args) {
        String token = Jwts.builder().setSubject("abc")
                .setExpiration(new Date(System.currentTimeMillis() + Constant.TOKEN_EXP_SECENDS * 10))
                .signWith(SignatureAlgorithm.HS512, Constant.JWT_SECRET).compact();

        System.out.println("==token===" + token);
    }
}
